home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / nos042_s / pop.h < prev    next >
C/C++ Source or Header  |  1994-09-16  |  2KB  |  68 lines

  1. /*
  2.             filename --  POP.H
  3.  
  4.             author   --  Mike Stockett, WA7DYX
  5.  
  6.             additional hacking by Allen Gwinn, N5CKP
  7.  
  8.          ATARI Version by David Nash - dnash@chaos.demon.co.uk
  9.  
  10.          condition out fcntl.h         
  11. */
  12.  
  13. #ifndef TRUE
  14. #define TRUE        1
  15. #define FALSE        0
  16. #endif
  17.  
  18. #define BUF_LEN        128
  19.  
  20. #ifndef ATARI
  21. #include <fcntl.h>
  22. #endif
  23.  
  24. /* ---------------- common server data structures ---------------- */
  25.  
  26. /* POP server control block */
  27.  
  28. struct pop_scb {
  29.     int    socket;        /* socket number for this connection */
  30.     char    state;        /* server state */
  31. #define            LSTN        0
  32. #define            AUTH        1
  33. #define            MBOX        2
  34. #define            ITEM        3
  35. #define               NEXT        4
  36. #define            DONE        5
  37.     char    buf[BUF_LEN],    /* input line buffer */
  38.         count,        /* line buffer length */
  39.         username[64];    /* user/folder name */
  40.     FILE    *wf;        /* work folder file pointer */
  41.     int    folder_len,    /* number of msgs in current folder */
  42.         msg_num;    /* current msg number */
  43.     long    msg_len;    /* length of current msg */
  44.     int    msg_status_size; /* size of the message status array */
  45.     long    curpos,        /* current msg's position in file */
  46.         folder_file_size, /* length of the current folder file, in bytes */
  47.         nextpos;    /* next msg's position in file */
  48.     unsigned int    folder_modified, /*  mail folder contents modified flag */
  49.         *msg_status;    /* message status array pointer */
  50. };
  51.  
  52. #define NULLSCB        (struct pop_scb *)0
  53.  
  54. /* Response messages */
  55.  
  56. static char    count_rsp[]    = "#%d messages in this folder\n",
  57.         error_rsp[]    = "- ERROR: %s\n",
  58.         greeting_msg[] = "+ POP2 %s\n",
  59. /*        length_rsp[]   = "=%ld bytes in this message\n", */
  60.         length_rsp[]   = "=%ld characters in Message #%d\n",
  61.         msg_line[]     = "%s\n",
  62.         no_mail_rsp[]  = "+ No mail, sorry\n",
  63.         no_more_rsp[]  = "=%d No more messages in this folder\n",
  64.         signoff_msg[]  = "+ Bye, thanks for calling\n";
  65.  
  66. /* ------------------------ end of header file ---------------------------- */
  67.  
  68.